home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS04.ADF / C / prtbase.h < prev    next >
C/C++ Source or Header  |  1985-12-04  |  5KB  |  141 lines

  1. /*********************************************************************
  2.  *                                                                   *
  3.  *   Copyright 1985, Commodore-Amiga Inc.   All rights reserved.     *
  4.  *   No part of this program may be reproduced, transmitted,         *
  5.  *   transcribed, stored in retrieval system, or translated into     *
  6.  *   any language or computer language, in any form or by any        *
  7.  *   means, electronic, mechanical, magnetic, optical, chemical,     *
  8.  *   manual or otherwise, without the prior written permission of    *
  9.  *   Commodore-Amiga Incorporated, 983 University Ave. Building #D,  *
  10.  *   Los Gatos, California, 95030                                    *
  11.  *                                                                   *
  12.  *********************************************************************
  13.  *
  14.  *      printer device data definition
  15.  *
  16.  ********************************************************************/
  17.  
  18. #ifndef DEVICES_PRTBASE_H
  19. #define DEVICES_PRTBASE_H
  20.  
  21.  
  22. #ifndef EXEC_NODES_H
  23. #include        "exec/nodes.h"
  24. #endif
  25. #ifndef EXEC_LISTS_H
  26. #include        "exec/lists.h"
  27. #endif
  28. #ifndef EXEC_PORTS_H
  29. #include        "exec/ports.h"
  30. #endif
  31. #ifndef EXEC_LIBRARIES_H
  32. #include        "exec/libraries.h"
  33. #endif
  34. #ifndef EXEC_TASKS_H
  35. #include        "exec/tasks.h"
  36. #endif
  37.  
  38. #ifndef DEVICES_PARALLEL_H
  39. #include        "devices/parallel.h"
  40. #endif
  41. #ifndef DEVICES_SERIAL_H
  42. #include        "devices/serial.h"
  43. #endif
  44. #ifndef DEVICES_TIMER_H
  45. #include        "devices/timer.h"
  46. #endif
  47. #ifndef LIBRARIES_DOSEXTENS_I
  48. #include        "libraries/dosextens.h"
  49. #endif
  50. #ifndef INTUITION_INTUITION_H
  51. #include        "intuition/intuition.h"
  52. #endif
  53.  
  54.  
  55. struct DeviceData {
  56.     struct Library dd_Device;   /* standard library node */
  57.     APTR        dd_Segment;     /* A0 when initialized */
  58.     APTR        dd_ExecBase;    /* A6 for exec */
  59.     APTR        dd_CmdVectors;  /* command table for device commands */
  60.     APTR        dd_CmdBytes;    /* bytes describing which command queue */
  61.     UWORD       dd_NumCommands; /* the number of commands supported */
  62. };
  63.  
  64.  
  65. #define P_STKSIZE       0x800
  66.  
  67. struct  PrinterData {
  68.     struct DeviceData pd_Device;
  69.     struct MsgPort pd_Unit;             /* the one and only unit */
  70.     BPTR pd_PrinterSegment;             /* the printer specific segment */
  71.     UWORD pd_PrinterType;               /* the segment printer type */
  72.     struct PrinterSegment *pd_SegmentData; /* the segment data structure */
  73.     UBYTE *pd_PrintBuf;                 /* the raster print buffer */
  74.     VOID (*pd_PWrite)();                /* the write function */
  75.     VOID (*pd_PBothReady)();            /* write function's done */
  76.     union {                             /* port I/O request 0 */
  77.         struct IOExtPar pd_p0;
  78.         struct IOExtSer pd_s0;
  79.     } pd_ior0;
  80. #define pd_PIOR0        pd_ior0.pd_p0
  81. #define pd_SIOR0        pd_ior0.pd_s0
  82.     union {                             /*   and 1 for double buffering */
  83.         struct IOExtPar pd_p1;
  84.         struct IOExtSer pd_s1;
  85.     } pd_ior1;
  86. #define pd_PIOR1        pd_ior1.pd_p1
  87. #define pd_SIOR1        pd_ior1.pd_s1
  88.     struct timerequest pd_TIOR;         /* timer I/O request */
  89.     struct MsgPort pd_IORPort;          /*   and message reply port */
  90.     struct Task pd_TC;                  /* write task */
  91.     UBYTE pd_Stk[P_STKSIZE];            /*   and stack space */
  92.     UBYTE pd_Flags;                     /* device flags */
  93.     UBYTE pd_pad;
  94.     struct Preferences pd_Preferences;  /* the latest preferences */
  95. };
  96.  
  97. #define PPCB_GFX        0
  98. #define PPCF_GFX        0x01
  99. #define PPCB_COLOR      1
  100. #define PPCF_COLOR      0x02
  101.  
  102. #define PPC_BWALPHA     0
  103. #define PPC_BWGFX       1
  104. #define PPC_COLORGFX    3
  105.  
  106. #define PCC_BW          1
  107. #define PCC_YMC         2
  108. #define PCC_YMC_BW      3
  109. #define PCC_YMCB        4
  110.  
  111. struct PrinterExtendedData {
  112.     char    *ped_PrinterName;   /* printer name, null terminated */
  113.     VOID    (*ped_Init)();      /* called after LoadSeg */
  114.     VOID    (*ped_Expunge)();   /* called before UnLoadSeg */
  115.     VOID    (*ped_Open)();      /* called at OpenDevice */
  116.     VOID    (*ped_Close)();     /* called at CloseDevice */
  117.     UBYTE   ped_PrinterClass;   /* printer class */
  118.     UBYTE   ped_ColorClass;     /* color class */
  119.     UBYTE   ped_MaxColumns;     /* number of print columns available */
  120.     UBYTE   ped_NumCharSets;    /* number of character sets */
  121.     UWORD   ped_NumRows;        /* number of raster rows in a raster dump */
  122.     ULONG   ped_MaxXDots;       /* number of dots maximum in a raster dump */
  123.     ULONG   ped_MaxYDots;       /* number of dots maximum in a raster dump */
  124.     UWORD   ped_XDotsInch;      /* horizontal dot density */
  125.     UWORD   ped_YDotsInch;      /* vertical dot density */
  126.     char    ***ped_Commands;    /* printer text command table */
  127.     VOID    (*ped_DoSpecial)(); /* special command handler */
  128.     VOID    (*ped_Render)();    /* raster render function */
  129.     LONG    ped_TimeoutSecs;    /* good write timeout */
  130. };
  131.  
  132. struct PrinterSegment {
  133.     ULONG   ps_NextSegment;             /* (actually a BPTR) */
  134.     ULONG   ps_runAlert;                /* MOVEQ #0,D0 : RTS */
  135.     UWORD   ps_Version;                 /* segment version */
  136.     UWORD   ps_Revision;                /* segment revision */
  137.     struct  PrinterExtendedData ps_PED; /* printer extended data */
  138. };
  139. #endif
  140.  
  141.